const enterpriseVue = new Vue({
  el: '#app',
  data() {
    //校验身份证号
    return {
      form: {
        mchid:"",
        serial_no: "",
        secret_key_V3: "",
        expires_in: "",
      },
      rules: [],
      enterpriseData:[],
      loading: false,
      disabled: false,
    }
  },
  mounted() {
    
  },
  methods: {
     //查询所有企业
    submitForm(type) {
      // this.$refs[type].validate((valid) => {
      //   if (valid) {
      //
      //   }
      // })
      const _this = this;
      _this.loading = true
      console.log(this.form);
      $.ajax({
        url: DomainName + '/getAddAction?token='+$.cookie("token"),
        data:{
             Data: JSON.stringify({ wechatpay: [_this.form] }),
        },
        success: function (res) {
          if (res.Status == 'success') {
            _this.$message.success("提交成功")
            window.history.go(-1);
          } else {
            _this.$message.error("提交失败，请稍后再试")
          }
        },
        complete: function (XMLHttpRequest) {
          _this.loading = false
          if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
            window.parent.document.location.href = "../../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
          }
        }
      })
    }
  }
})